#如果包含字符串

$q = { 'apple', 'banana', 'orange', 'apple', 'banana' }
$q = 'banana'

for ($i = 0; $i -lt $q.Count; $i++) {
    switch ($q[$i]) {
        condition { 
            case "apple" {
                Write-Output $q[$i]
            }
            case "banana" {
                Write-Output $q[$i].ToString()
            }
        }
        Default {
            Write-Output $q[$i]
        }
    }
}

